/*
 * Location.java
 *
 * Created on November 6, 2006, 2:28 PM
 */

package com.asaga.tools;

import java.beans.*;
import java.io.Serializable;
import java.util.ArrayList;

/**
 * 
 * Stub implementation of Location Interface
 * @author mmixon
 */
public class Location_StubImpl extends Object implements Location{
    
    private int id;
    private String title;
    private String addr1;
    private String addr2;
    private String city;
    private String state;
    private int zip;
    private String phone;
    private String website;
    private String contactName;
    private String contactEmail;
    private LocationVenue[] locationList;
    private LocationVenue venue;
   
    
    /**
     * Constructor of Location_StubImpl
     */
    public Location_StubImpl() {
        setLocationList(new LocationVenue[100]);
        getLocationList()[0] = new LocationVenue(1, "Georgia World Congress Center", "123 Peachtree St.", "", "Atlanta",
                "GA", 30303, "404-555-9900", "http://www.gwcc.org", "Jack Jones", "jjones@gwcc.org");
        getLocationList()[1] = new LocationVenue(2, "Tate Student Center", "123 Sanford Dr", "", "Athens",
                "GA", 30602, "706-542-9900", "http://www.uga.edu", "Michael Adams", "madams@uga.edu");
        getLocationList()[2] = new LocationVenue(3, "YMCA", "123 MLK, Dr.", "", "Atlanta",
                "GA", 30303, "404-777-9900", "http://www.ymca.org", "Elaine Green", "egreen@ymca.org");
        venue = new LocationVenue();
    }

    /**
     * Get Location ID
     * @return returns id of the location
     */
    public int getId() {
        return id;
    }

    /**
     * Set Location ID
     * @param id set's the location id
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * Get Title Method
     * @return Returns the title of the location
     */
    public String getTitle() {
        return title;
    }

    /**
     * Set Title Method
     * @param title the title to be set
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * Get Addr1
     * @return Returns the first address line.
     */
    public String getAddr1() {
        return addr1;
    }

    /**
     * Set Addr1
     * @param addr1 Sets the first address line.
     */
    public void setAddr1(String addr1) {
        this.addr1 = addr1;
    }

    /**
     * Get Addr2
     * @return returns the second address line
     */
    public String getAddr2() {
        return addr2;
    }

    /**
     * Set Addr2
     * @param addr2 sets the secon address line.
     */
    public void setAddr2(String addr2) {
        this.addr2 = addr2;
    }

    /**
     * Get City Method
     * @return returns city
     */
    public String getCity() {
        return city;
    }

    /**
     * Set City Method
     * @param city sets the city to this parameter
     */
    public void setCity(String city) {
        this.city = city;
    }

    /**
     * Get State Method
     * @return returns state attribute
     */
    public String getState() {
        return state;
    }

    /**
     * Set State Method
     * @param state sets the state attribute.
     */
    public void setState(String state) {
        this.state = state;
    }

    /**
     * Get Zip Method
     * @return returns the zip of the location.
     */
    public int getZip() {
        return zip;
    }

    /**
     * Set Zip Method
     * @param zip sets the zip attribute.
     */
    public void setZip(int zip) {
        this.zip = zip;
    }

    /**
     * Get Phone Method
     * @return method returns the phone number of the location.
     */
    public String getPhone() {
        return phone;
    }

    /**
     * Set Phone Method
     * @param phone sets the phone attribute.
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * Get Website Method
     * @return returns the website attribute.
     */
    public String getWebsite() {
        return website;
    }

    /**
     * Set Website Method
     * @param website sets the website attribute.
     */
    public void setWebsite(String website) {
        this.website = website;
    }

    /**
     * Get Contact Name Method
     * @return returns the contact name
     */
    public String getContactName() {
        return contactName;
    }

    /**
     * Set Contact Name method
     * @param contactName sets contactName attribute.
     */
    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    /**
     * Get Contact Email Method
     * @return returns the contactEmail attribute
     */
    public String getContactEmail() {
        return contactEmail;
    }

    /**
     * Set Contact Email Method
     * @param contactEmail sets the contactEmail attribute
     */
    public void setContactEmail(String contactEmail) {
        this.contactEmail = contactEmail;
    }

    /**
     * Get Location List Method
     * @return returns the list of locations
     */
    public LocationVenue[] getLocationList() {
        return locationList;
    }

    /**
     * Set Location List Method
     * @param locationList sets the locationList method.
     */
    public void setLocationList(LocationVenue[] locationList) {
        this.locationList = locationList;
    }

    /**
     * Add Location Method
     */
    public void addLocation() {
    }

    /**
     * Get Venu Method
     * @return returns the venue attribute
     */
    public LocationVenue getVenue() {
        return venue;
    }

    /**
     * Set Venue Method
     * @param venue sets the venu method
     */
    public void setVenue(LocationVenue venue) {
        this.venue = venue;
    }
    
    /**
     * Set Venue By Id Method
     * @param id uses the id to set the correct venue
     */
    public void setVenueById(int id){
        venue = locationList[id-1];
        this.id = venue.getId();
        title = venue.getTitle();
        city = venue.getCity();
        addr1 = venue.getAddr1();
        addr2 = venue.getAddr2();
        state = venue.getState();
        contactEmail = venue.getContactEmail();
        contactName = venue.getContactName();
        website = venue.getWebsite();
        zip = venue.getZip();
        
    }

    /**
     * Get Venue Method
     * @param id the id of the venue
     * 
     * @return returns the specified venue
     */
    public LocationVenue getVenueById(int id){
            return locationList[id];
    }
}
